<template>
  <div class="home">
    <ColumnsList :listData="listData"></ColumnsList>
  </div>
</template>

<script lang="ts">
import { defineComponent, onMounted, computed } from 'vue';
import ColumnsList from '@/views/ColumnsList.vue';
import { useStore } from 'vuex';
export default defineComponent({
  name: 'home',
  components: {
    ColumnsList
  },
  setup() {
    const store = useStore();
    onMounted(() => {
      store.dispatch('fetchColumns');
    });
    // 使用本地测试数据
    // const listData = reactive<ColumnProps[]>(testColumns);
    // 使用接口数据
    const listData = computed(() => store.state.columns);
    return { listData };
  }
});
</script>

<style lang="less" scoped>
.home {
  background-color: #fff;
}
</style>
